﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;

namespace Model
{
    [Serializable]
    public partial class Pot0a06
    {
        private int? _calcode;
		private string _calname;
		
        /// <summary>
        /// 算法代码
        /// </summary>
		public int? Calcode
		{
			get { return _calcode;	 }
			set { _calcode=value;	}
		}
        /// <summary>
        /// 算法名称
        /// </summary>
		public string Calname
		{
			get { return _calname;	 }
			set { _calname=value;	}
		}
		
		public static List<Pot0a06> GetPot0a06ListByDataTable(DataTable dt)
		{
			if(dt == null) return null;
		    List<Pot0a06> list = new List<Pot0a06>();
		   
			foreach(DataRow dr in dt.Rows)
            {
				Pot0a06 model = GetPot0a06ByDataRow(dr);
				if(null == model) continue;
				
				list.Add(model);
            }
           return list;
		}
		
		public static Pot0a06 GetPot0a06ByDataRow(DataRow dr)
		{
			Pot0a06 model = new Pot0a06(); //实例化Pot0a06
	
			DataColumnCollection dcc = dr.Table.Columns;

			if (dcc.Contains("calcode")&&!(dr["calcode"] is System.DBNull))  
				model.Calcode = ( int)dr["calcode"];
			if (dcc.Contains("calname")&&!(dr["calname"] is System.DBNull))  
				model.Calname = ( string)dr["calname"];
			
			return model;
		}
    }
}
